'use strict';db("mr.TestProvider");var Px,Yv,Qx=db("mr.Init"),Rx=function(a){void 0!==a.use_views_dialog&&Qx.info("Using the "+(a.use_views_dialog?"Views (Harmony)":"WebUI")+" dialog.");void 0!==a.enable_cast_sink_query&&Qx.info("Native Cast MRP is "+(a.enable_cast_sink_query?"disabled":"enabled")+".");void 0!==a.use_mirroring_service&&Qx.info("Native Mirroring Service is "+(a.use_mirroring_service?"enabled":"disabled")+".")};Ir().init();Px=new Eb("MediaRouter.Provider.WakeDuration");Yv=new ow;
var Sx=(new Promise(function(a,b){switch(window.location.host){case "enhhojjnijigcajfphajepfemndkmdlo":a();break;case "pkedcjkdefgpdelpbcmbmeomcjbeemfm":chrome.management.get("enhhojjnijigcajfphajepfemndkmdlo",function(c){chrome.runtime.lastError||!c.enabled?a():b(Error("Dev extension is enabled"))});break;default:b(Error("Unknown extension id"))}})).then(function(){return chrome.mojoPrivate&&chrome.mojoPrivate.requireAsync?new Promise(function(a){chrome.mojoPrivate.requireAsync("media_router_bindings").then(function(b){mojo=b.getMojoExports&&
b.getMojoExports();b.start().then(function(c){a({mrService:b,mrInstanceId:c.instance_id||c,mrConfig:c.config})})})}):Promise.reject(Error("No mojo service loaded"))}).then(function(a){if(!a.mrService)throw Error("Failed to get MR service");var b=a.mrInstanceId;if(!b)throw Error("Failed to get MR instance ID.");Qx.info("MR instance ID: "+b);Rx(a.mrConfig);var c=a.mrService;if(!Yv)throw Error("providerManager not initialized.");c.setHandlers(Yv);hm(b)&&(Px.g="MediaRouter.Provider.FirstWakeDuration");
chrome.runtime.onSuspend.addListener(Px.end.bind(Px));lm(b);Lr();b=Xv(!!a.mrConfig.enable_cast_sink_query);window.addEventListener("unhandledrejection",function(d){d=d.reason;d.stack||(d=Error(d));Qx.error("Unhandled promise rejection.",d)});rw(c,b,a.mrConfig)}).then(void 0,function(a){Qx.L(a.message);throw a;});[].concat(p([Wv(),Tv()].concat(p(Hp())))).forEach(function(a){fm(a)});Wv().addListener();Tv().addListener();chrome.runtime.onStartup.addListener(function(){});Sx.then(void 0,function(){return window.close()});
